package cn.drenal.capcap.entity.base;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.autotable.annotation.ColumnComment;
import com.tangzc.autotable.annotation.ColumnDefault;
import com.tangzc.autotable.annotation.ColumnNotNull;
import com.tangzc.mpe.annotation.InsertFillTime;
import com.tangzc.mpe.annotation.InsertUpdateFillTime;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基础实体类，包含通用字段
 */
@Data
public class BaseEntity implements Serializable {
    @ColumnComment("是否删除：0-未删除，1-已删除")
    @ColumnNotNull
    @ColumnDefault("0")
    protected Integer isDeleted;

    @ColumnComment("创建时间")
    @InsertFillTime
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;

    @ColumnComment("更新时间")
    @InsertUpdateFillTime
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime updateTime;
}